
package application;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;

import jeopardy.common.Utils;
import jeopardy.common.protocol.game.play.AnswerMsg;
import jeopardy.common.protocol.game.play.CurrentUsersMsg;
import jeopardy.common.protocol.game.play.GameRecordMsg;
import jeopardy.common.protocol.game.play.NewQuestionMsg;
import jeopardy.common.protocol.game.play.NotifyStartMsg;
import jeopardy.common.protocol.game.play.QnAAttemptedMsg;
import jeopardy.common.protocol.game.play.QuestionAnswerMsg;
import jeopardy.common.protocol.useraccount.UserAccountConsts;
import jeopardy.common.protocol.useraccount.UserAccountRequest;
import jeopardy.common.protocol.useraccount.UserAccountUtils;



public class ScreensFramework extends Application {
    
    /*   */
    public static String WelcomeScreenID = "main";
    public static String WelcomeScreenFile = "WelcomeScreen.fxml";

    /*   */
    public static String LoginScreenID = "LoginScreen";
    public static String LoginScreenFile = "LoginScreen.fxml";
    
    /*   */
    public static String PostLoginScreenID = "PostLoginScreen";
    public static String PostLoginScreenFile = "PostLoginScreen.fxml";
    
    /*   */
    public static String RegistrationScreenID = "RegistrationScreen";
    public static String RegistrationScreenFile = "RegistrationScreen.fxml";
    
    /*   */
    public static String PreGameScreenID = "PreGameScreen";
    public static String PreGameScreenFile = "PreGameScreen.fxml";

  /************** Uncomment when GameScreen is ready  
    public static String GameScreenID = "GameScreen";
    public static String GameScreenFile = "GameScreen.fxml";
  **************/
    public static String GameScreenID = "GameScreen";
    public static String GameScreenFile = "GameScreen.fxml";
    
    @Override
    public void start(Stage primaryStage) {
    	
    	LoginScreenLogic jeopardy = new LoginScreenLogic();
        
        ScreensController mainContainer = new ScreensController();
        
        mainContainer.loadScreen(ScreensFramework.WelcomeScreenID, ScreensFramework.WelcomeScreenFile);
        
        mainContainer.loadScreen(ScreensFramework.LoginScreenID, ScreensFramework.LoginScreenFile);
       
        mainContainer.loadScreen(ScreensFramework.PreGameScreenID, ScreensFramework.PreGameScreenFile);
       
        /************** Uncomment when GameScreen is ready  
        mainContainer.loadScreen(ScreensFramework.GameScreenID, ScreensFramework.GameScreenFile);
          **************/

        mainContainer.loadScreen(ScreensFramework.PostLoginScreenID, ScreensFramework.PostLoginScreenFile);
        
        mainContainer.loadScreen(ScreensFramework.RegistrationScreenID, ScreensFramework.RegistrationScreenFile);
        
        mainContainer.setScreen(ScreensFramework.WelcomeScreenID);
        
        Group root = new Group();
        root.getChildren().addAll(mainContainer);
        Scene scene = new Scene(root);
        primaryStage.setScene(scene);
        primaryStage.show();
        
    }

    /**
     * The main() method is ignored in correctly deployed JavaFX application.
     * main() serves only as fallback in case the application can not be
     * launched through deployment artifacts, e.g., in IDEs with limited FX
     * support. NetBeans ignores main().
     *
     * @param args the command line arguments
     */
    public static void main(String[] args) {
    	
    	launch(args);
    }
}
